﻿using Samurai.Client.Windows;
using Samurai.Infrastructure;
using Samurai.Client.DataContexts;

namespace Samurai.Client.Commands
{
    public class EditMovieCommand : CommandBase
    {
        public EditMovieCommand()
        {

        }

        public bool CanExecute(object parameter)
        {
            return true;
        }        

        protected override void InvokeExecute(object parameter)
        {
            var movie = (Movie)parameter;

            var dataContext = new EditMovieDataContext(movie);

            var editMovieWindow = new EditMovieWindow();

            editMovieWindow.DataContext = dataContext;

            editMovieWindow.ShowDialog();
        }
    }
}
